package club.beimeng.TestMap;

import java.util.*;

public class ForMap {
    public static void main(String[] args) {

        HashMap<String, String> map = new HashMap<>();
        map.put("a","包龙");
        map.put("b","阿蔡");

        for (String key : map.keySet()) {
            System.out.printf("key - %s|value - %s\n", key,map.get(key));
        }

        Set<Map.Entry<String, String>> entrySet = map.entrySet();
        for (Map.Entry<String, String> stringStringEntry : entrySet) {
            System.out.println(stringStringEntry);
        }
    }
}
